1 WRANGLING

Initial data were collected via Qualtrics surveys named MAG_S2_PROLIFIC-DATACOLLAR_0 and MAG_S2_PROLIFIC-DATACOLLAR_0, each presenting participants with one common graph (“block 0”, STIMULUS = B0-0) and four subsequent graphs in random order (“block 1”). The 24 stimuli are organized in 6 blocks, and we started by collecting data for block 1 to test data quality and runtime of the survey instrument.

Notes on Qualtrics Survey Status

In Qualtrics, when a survey is:

  • abandoned; Finished = False and Progress < 100%

  • fails consent or pre-screening, Finished = TRUE, Progress = 100%, Q_TerminateFlag = “Screened”

  • complete; Finished = TRUE, Progress = 100%

#### RAW DATA ####################################################################
# will always be the unaltered version of imported data
# 1 row per subject 
df_raw_datacollar <- read_csv("data/input/CLEAN_MAG_S2_PROLIFIC-DATACOLLAR_B1.csv", col_names = TRUE)
df_raw_bluecollar <- read_csv("data/input/CLEAN_MAG_S2_PROLIFIC-BLUECOLLAR_B1.csv", col_names = TRUE)
df_raw_b2 <- read_csv("data/input/CLEAN_MAG_S2_PROLIFIC-GENERAL_B2.csv", col_names = TRUE)
df_raw_b6 <- read_csv("data/input/CLEAN_MAG_S2_PROLIFIC-GENERAL_B6.csv", col_names = TRUE)

# drop first two rows (qualtrics_specs)
df_raw_datacollar <- df_raw_datacollar[-c(1:2),]
df_raw_bluecollar <- df_raw_bluecollar[-c(1:2),]
df_raw_b2 <- df_raw_b2[-c(1:2),]
df_raw_b6 <- df_raw_b6[-c(1:2),]

#ADD DUMMY COLS TO DATA/BLUE COLLAR PILOT DATA 
# x <- compare_df_cols(df_raw_b2, df_raw_pilot)
df_raw_pilot <- rbind(df_raw_datacollar, df_raw_bluecollar) %>% 
  mutate(
    '0_Q_B0_CHART_ACTION' = NA,
    '1_Q_B1_CHART_ACTION' = NA,
    '1_Q_B2_CHART_ACTION' = NA,
    '1_Q_B3_CHART_ACTION' = NA,
    '1_Q_B4_CHART_ACTION' = NA,
    '1_Q_B5_CHART_ACTION' = NA,
    '1_Q_B6_CHART_ACTION' = NA,
    '2_Q_B1_CHART_ACTION' = NA,
    '2_Q_B2_CHART_ACTION' = NA,
    '2_Q_B3_CHART_ACTION' = NA,
    '2_Q_B4_CHART_ACTION' = NA,
    '2_Q_B5_CHART_ACTION' = NA,
    '2_Q_B6_CHART_ACTION' = NA,
    '3_Q_B1_CHART_ACTION' = NA,
    '3_Q_B2_CHART_ACTION' = NA,
    '3_Q_B3_CHART_ACTION' = NA,
    '3_Q_B4_CHART_ACTION' = NA,
    '3_Q_B5_CHART_ACTION' = NA,
    '3_Q_B6_CHART_ACTION' = NA,
    '4_Q_B1_CHART_ACTION' = NA,
    '4_Q_B2_CHART_ACTION' = NA,
    '4_Q_B3_CHART_ACTION' = NA,
    '4_Q_B4_CHART_ACTION' = NA,
    '4_Q_B5_CHART_ACTION' = NA,
    '4_Q_B6_CHART_ACTION' = NA
  )



df_raw <- rbind(df_raw_pilot,df_raw_b2, df_raw_b6)
rm(df_raw_datacollar, df_raw_bluecollar, df_raw_b2, df_raw_b6, df_raw_pilot, x)

#### MASTER WIDE FORMAT DATA FRAME [1 row / qualtrics submission] ################
df_raw_clean <- df_raw %>% 
  select(
    -EndDate, -IPAddress, -RecordedDate,
    -RecipientLastName, -RecipientFirstName, -RecipientEmail,
    -ExternalReference, -LocationLatitude, -LocationLongitude, 
    -DistributionChannel, -UserLanguage, -Q_RecaptchaScore,
    -P_BROWSER_Version, -P_BROWSER_Resolution, 
    -CONSENT, -ELIGIBILITY, 
    -randomize_common, -stimulus_common, #hidden q that controls common stimulus url
    -FL_14_DO, #not actually randomization order
    -contains("First Click"), -contains("Last Click"), -contains("Click Count"),
    -T_EMAIL, -T_BROWSER_Version, -T_BROWSER_Resolution, 
    -D_politicalParty_DO, 
    -ID_PROLIFIC, -ID_STUDY, -ID_SESSION #redundant to other cols 
  ) %>% 
  rename(
    duration.sec = `Duration (in seconds)`,
    EndState = End_State, 
    TerminateFlag = Q_TerminateFlag,
    Source = Status, #where the survey originated from (should not be preview or test)
    PLATFORM = Q_PLATFORM,
    ID.Qualtrics = ResponseId,
    ID.Prolific = PROLIFIC_PID,
    ID.Study = STUDY_ID,
    ID.Session = SESSION_ID,
    P_BROWSER_OS = `P_BROWSER_Operating System`,
    T_BROWSER_OS = `T_BROWSER_Operating System`,
    SCREEN_workFunction_TEXT = SCREEN_workFunction_22_TEXT, 
    SCREEN_socialMedia_TEXT = SCREEN_socialMedia_18_TEXT,
    D_politicalParty_OTHER = D_politicalParty_4_TEXT,
    D_politicsSocial = D_politicsSocial_1,
    D_politicsFiscal = D_politicsFiscal_2
 ) %>% 
  mutate(
# STUDY IDS
# 65ceb65b05030d95c598ef1b - blue collar 
# 65c53fd727dceff9fd360b09 - data collar 
    D_politicsSocial = as.numeric(D_politicsSocial),
    D_politicsFiscal = as.numeric(D_politicsFiscal),
    #HARHDCODED PROLIFIC SAMPLE IDS 
    ID.Study = factor(ID.Study, 
                      levels = c("65c53fd727dceff9fd360b09", "65ceb65b05030d95c598ef1b","65d8f06b624798854f7f6872","65e125ddf213381ee6b67177"),
                      labels = c("datacollar","bluecollar","block2","block6")),
    # StartDate = mdy_hm(StartDate),
    duration.sec = as.numeric(duration.sec), #weird booleans should only be for the test generator
    duration.min = round(duration.sec/60,2),
    Progress = as.numeric(Progress), 
    D_education = factor( D_education,
                          levels = c(
                            "NA",
                            "Some high school or less",
                            "High school diploma or GED",
                            "Associates or technical degree",
                            "Some college, but no degree",
                            "Graduate or professional degree (MA, MS, MBA, PhD, JD, MD, DDS etc.)"
                          ), 
                          labels = c(
                            "NA",
                            "< HS",
                            "HS/GED",
                            "Associates",
                            "Some college",
                            "Grad/Proff"
                          )
      ),
    D_politicalParty = factor(D_politicalParty, levels = c("NA", "Independent", "Democrat", "Republican", "Other")),
    D_age = factor(D_age, 
                   levels = c("25-34 years old" ,
                              "18-24 years old" ,
                              "45-54 years old" ,
                              "35-44 years old" ,
                              "65+ years old"   ,
                              "55-64 years old"), 
                   labels = c("25-34", "18-24", "45-54","35-44","65+ years","55-64"))
  ) %>%
  rename_at(
  #REPLACE RANDOM TRAILING _1 AND _65 FROM QUALTRICS
    vars(contains('_65')), funs(sub('_65', '', .))
  ) %>% 
  rename_at(
    vars(contains('_1')), funs(sub('_1', '', .))
  ) %>% 
  rename_at(
   vars(contains('_Page Submit')), funs(sub('_Page Submit', '', .))
  ) %>% 
  rename_at( #CHANGE DETAIL QUESTION DELIMITER FOR PIVOT PURPOSES 
   vars(contains('_CHART_')), funs(sub('_CHART_', '_CHART-', .))
  ) %>% 
  rename_at( #CHANGE DETAIL QUESTION DELIMITER FOR PIVOT PURPOSES 
   vars(contains('_MAKER_')), funs(sub('_MAKER_', '_MAKER-', .))
  ) %>% 
  rename_at( #CHANGE DETAIL QUESTION DELIMITER FOR PIVOT PURPOSES 
   vars(contains('_AGE_')), funs(sub('_AGE_', '_AGE-', .))
  ) %>% 
  rename_at( #CHANGE DETAIL QUESTION DELIMITER FOR PIVOT PURPOSES 
   vars(contains('_GENDER_')), funs(sub('_GENDER_', '_GENDER-', .))
  ) %>% 
  rename_at( #CHANGE DETAIL QUESTION DELIMITER FOR PIVOT PURPOSES 
   vars(contains('_TOOL_')), funs(sub('_TOOL_', '_TOOL-', .))
   ) %>% 
  select ( #reodering
    ID.Qualtrics, ID.Prolific:ID.Session, 
    Source, Progress, Finished, EndState, TerminateFlag, 
    StartDate, duration.min, PLATFORM,
    P_BROWSER_Browser, P_BROWSER_OS, T_BROWSER_Browser, T_BROWSER_OS, 
    D_gender:D_politicsFiscal, SCREEN_workMethod:SCREEN_socialMedia_TEXT, 
    PURPOSE, FEEDBACK , 
    `0_Q_B0_ENCOUNTER`:`4_Q_B6_CHART-LATENCY`
  )  %>% 
  mutate ( #set factors 
    ID.Qualtrics = factor(ID.Qualtrics),
    ID.Prolific = factor(ID.Prolific),
    # ID.Study = factor(ID.Study),
    ID.Session = factor(ID.Session),
    PLATFORM = factor(PLATFORM),
    Source = factor(Source),
    Finished = as.logical(Finished),
    TerminateFlag = factor(TerminateFlag)
  ) 

#### SEGREGATE PARTICIPANTS WHO DID NOT COMPLETE ###############################
## [1 row / qualtrics submission] ################
## NOTE it is common for prolific participants to fail the 
## screening verification, and then try again but change their 
## screening verification answers (ie. one prolific ID for multiple qualrics IDs)
df_nofinish <- df_raw_clean %>% 
  filter( 
    !is.na(TerminateFlag) | Finished == FALSE   
  ) %>% 
  select(
    ID.Qualtrics, ID.Prolific, ID.Study, Source, Progress, 
    Finished, TerminateFlag, EndState) %>% 
  mutate(
    EndState = ifelse( (Progress < 100), "abandoned", EndState)
  )



#### MASTER VALID DATA [WIDE] 1 row per qualtrics entry #########################
## [1 row / qualtrics submission] ################
df_data <- df_raw_clean %>% filter(
  ID.Qualtrics %nin% df_nofinish$ID.Qualtrics
  # (Finished == TRUE ) & is.na(TerminateFlag)
)

#sanity check === SHOULD BE O
#no qualtrics surveys in good data that weren't finished
print("Number of Qualtrics entries in df_data AND nofinish? [should be 0]")
## [1] "Number of Qualtrics entries in df_data AND nofinish? [should be 0]"
sum(df_data$ID.Qualtrics %in% df_nofinish$ID.Qualtrics)
## [1] 0
#sanity check === SHOULD BE O
#no duplicated PROLIFIC ids in good data 
print("Number of Prolific IDs duplicated in df_data print [should be 0]")
## [1] "Number of Prolific IDs duplicated in df_data print [should be 0]"
sum(duplicated(df_data$ID.Prolific))
## [1] 0
#### QUESTION LEVEL DATA FRAME (LONG) ##########################
# unravel ALL the way down to questions 
# 1 row per participant-graph-question
df_questions <- df_data %>% 
  select(
  ID.Qualtrics:ID.Study, PLATFORM, 
  contains("_Q_"), contains("loop")
) %>% 
  pivot_longer( #PIVOT ON stimulus
  cols = contains("_Q_"),
  names_to = c("stimulus","dummy","BLOCK","QUESTION"),
  values_to = c("value"),
  names_sep = "_"
) %>% select(-dummy) %>% 
  unite(
   BLOCK:stimulus, col="STIMULUS", sep="-", remove=FALSE
) %>% 
  mutate(
    BLOCK = factor(BLOCK),
    STIMULUS = factor(STIMULUS),
    QUESTION = str_replace_all(QUESTION,"-","_"),
    QUESTION = factor(QUESTION)
) %>% 
  select(-stimulus) %>% filter(!is.na(value))


#### CHART LEVEL DATA FRAME (LONG) ##########################
# 1 row per participant X graph 
# unnest https://stackoverflow.com/questions/58035452/pivot-wider-outputs-s3-vctrs-list-of-objects
df_graphs_full <- df_questions %>% 
  pivot_wider(
    names_from = QUESTION,
    values_from = value 
  ) %>%  
  tidyr::unnest() %>%  # handle r coerces values to lists
  mutate(
    across(contains("_ID") | contains("MAKER_GENDER") | contains("MAKER_AGE"), factor),
    across(contains("_CONF") | contains("_LATENCY"), as.numeric),
    across(MAKER_DESIGN:MAKER_TRUST, as.numeric),
    across(CHART_LIKE:CHART_TRUST, as.numeric),
    ENCOUNTER = factor(ENCOUNTER),
    loop_number = as.numeric(loop_number),
    loop_number = ifelse(is.na(loop_number), 0, loop_number),
    MAKER_LATENCY = round(MAKER_LATENCY/60,2), #CHANGE TO MINS
    CHART_LATENCY = round(CHART_LATENCY/60,2), #CHANGE TO MINS
    MAKER_ID = factor( MAKER_ID,levels = c("business", "political", "education","news","organization","individual"))
  )

##TODO HANDLE MULTISELECT INCL CHART ACTION


## SUBSET OF COLUMNS EXCLUDING THE FREE RESPONSES
df_graphs <- df_graphs_full %>% 
  select( !is.character)



#### CHART LEVEL DATA FRAME (LONG) FOR QDA (incl demographics) ##################
# 1 ROW / participant X GRAPH including demographics 
# UNRAVEL TO QUESTIONS
df_qda <- df_data %>% 
  # select(
  # ID.Qualtrics:ID.Study, PLATFORM, 
  # contains("_Q_"), contains("loop")
# ) %>% 
  pivot_longer( #PIVOT ON stimulus
  cols = contains("_Q_"),
  names_to = c("stimulus","dummy","BLOCK","QUESTION"),
  values_to = c("value"),
  names_sep = "_"
) %>% select(-dummy) %>% 
  unite(
   BLOCK:stimulus, col="STIMULUS", sep="-", remove=FALSE
) %>% 
  mutate(
    BLOCK = factor(BLOCK),
    STIMULUS = factor(STIMULUS),
    QUESTION = str_replace_all(QUESTION,"-","_"),
    QUESTION = factor(QUESTION)
) %>% 
  select(-stimulus) %>% 
# RE-RAVEL UP TO STIMULI
  filter(!is.na(value)) %>% 
   pivot_wider(
    names_from = QUESTION,
    values_from = value 
  ) %>%  
  tidyr::unnest() %>%  # handle r coerces values to lists
  mutate(
    across(contains("_ID") | contains("MAKER_GENDER") | contains("MAKER_AGE"), factor),
    across(contains("_CONF") | contains("_LATENCY"), as.numeric),
    across(MAKER_DESIGN:MAKER_TRUST, as.numeric),
    across(CHART_LIKE:CHART_TRUST, as.numeric),
    ENCOUNTER = factor(ENCOUNTER),
    loop_number = as.numeric(loop_number),
    loop_number = ifelse(is.na(loop_number), 0, loop_number),
    MAKER_LATENCY = round(MAKER_LATENCY/60,2), #CHANGE TO MINS
    CHART_LATENCY = round(CHART_LATENCY/60,2) #CHANGE TO MINS
  )
#WRITE A CSV FILE AS THE BASIS FOR THE QUALITATIVE DATA ANALYSIS
write.csv(df_qda, file = "data/output/df_qda.csv", na="")


#CHECK BLOCKS PER PARTICIPANT
# every participant should have 2 blocks
check_subject_blocks <- df_questions %>%
  group_by(ID.Qualtrics) %>% summarise(
    n_block = length(unique(BLOCK))
  )
all(check_subject_blocks$n_block==2)
## [1] TRUE
#CHECK STIMULI PER PARTICIPANT
# every participant should have 5 graphs
check_subject_graphs <- df_questions %>% 
  group_by(ID.Qualtrics) %>%summarise(
    n_graphs = length(unique(STIMULUS))
  ) #each participant should have five graphs
all(check_subject_graphs$n_graphs==5)
## [1] TRUE
# title = "Participants by Condition and Data Collection Modality"
# cols = c("Control Condition","Impasse Condition","Total for Period")
print("Number of abandoned/screened no finish attempts")
## [1] "Number of abandoned/screened no finish attempts"
table(df_nofinish$ID.Study)
## 
## datacollar bluecollar     block2     block6 
##         57         44          9          6
print("Number of successful surveys")
## [1] "Number of successful surveys"
table(df_data$ID.Study)
## 
## datacollar bluecollar     block2     block6 
##         20         20         20         19
# cont %>% addmargins() %>% kbl(caption = title, col.names = cols) %>%  kable_classic()



#CLEANUP
rm(check_subject_blocks, check_subject_graphs, df_graphs_qda)


#TEMP RECODE PILOT STUDYID
df_graphs <- df_graphs %>% mutate(
  ID.Study = recode(ID.Study, "datacollar"="block1", "bluecollar"="block1")
)

df_data <- df_data %>% mutate(
  ID.Study = recode(ID.Study, "datacollar"="block1", "bluecollar"="block1")
)



# `r nrow(df_raw)` submissions were received via Qualtrics (`r nrow(df_master %>% filter(ID.Study=="datacollar"))` data-collar, `r nrow(df_master %>% filter(ID.Study=="bluecollar"))` blue-collar). Of these submissions, `r nrow(df_nofinish)` were incomplete (`r nrow(df_nofinish %>% filter(EndState == "abandoned"))` surveys abandoned, and `r nrow(df_nofinish %>% filter(TerminateFlag == "Screened"))` failed screening questions.
# 
# Dataframe descriptions:
# 
# -   `df_raw` is raw data from each qualtrics survey, combined; 1 row per Qualtrics submission ( `r nrow(df_raw)` total qualtrics attempts)
# 
# -   `df_raw_clean` is wrangled data from raw, with only relevant columns; 1 row per Qualtrics submission (`r nrow(df_master)` total qualtrics attempts)
# 
# -   `df_nofinish` is data for invalid submissions (abandonded or screened out due to not matching the pre-screening questions in prolific) (`r nrow(df_nofinish)` incomplete submissions) NOTE that these do not indicate unique participants. In some instances, the same `ID.Prolific` is associated with multiple (incomplete) attempts.
# 
# -   `df_data` is data for completed, valid submissions; 1 row per complete Qualtrics submission = 1 participant (`r nrow(df_data)` total valid submissions)
# 
# -   `df_graphs` is valid data pivoted long *without* free response questions; 1 row per participant X graph (`r nrow(df_graphs)`) participant-graph records)
# 
# -   `df_graphs_full` is valid data pivoted long *including* free response questions; 1 row per participant X graph (`r nrow(df_graphs_full)`) participant-graph records)
# 
# -   `df_subjects` is valid data (1 row per participant)

1.1 PROFILE DATA

df_graphs%>% summarytools::dfSummary(
             varnumbers = FALSE,
             plain.ascii  = FALSE,
             graph.magnif = 0.75,
             style        = "grid",
             tmp.img.dir  = "temp",
             missing.col = FALSE, 
             method = "render"
)
## temporary images written to '/Users/amyraefox/Code/MAG-Magic_Visualization/MAG/Studies/S2-surveys/2_prototype/temp'
## ### Data Frame Summary  
## #### df_graphs  
## **Dimensions:** 395 x 29  
## **Duplicates:** 0  
## 
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | Variable       | Stats / Values                  | Freqs (% of Valid)  | Graph                | Valid    | Missing |
## +================+=================================+=====================+======================+==========+=========+
## | ID.Qualtrics\  | 1\. R_12JREZApC5iEqSF\          | 0 ( 0.0%)\          | ![](temp/ds0233.png) | 395\     | 0\      |
## | [factor]       | 2\. R_133GgyRbPsqfxPD\          | 5 ( 1.3%)\          |                      | (100.0%) | (0.0%)  |
## |                | 3\. R_18Mwg4NFTa8GyAh\          | 5 ( 1.3%)\          |                      |          |         |
## |                | 4\. R_18SQ7VoPcbO4qzk\          | 0 ( 0.0%)\          |                      |          |         |
## |                | 5\. R_19SlHzR91R4mdQ5\          | 0 ( 0.0%)\          |                      |          |         |
## |                | 6\. R_1azgETg5gjYGzUf\          | 5 ( 1.3%)\          |                      |          |         |
## |                | 7\. R_1Cei7iCZO19u3Ic\          | 0 ( 0.0%)\          |                      |          |         |
## |                | 8\. R_1cvhMgSCJ71LBeC\          | 0 ( 0.0%)\          |                      |          |         |
## |                | 9\. R_1dzvbStETdGhNLA\          | 5 ( 1.3%)\          |                      |          |         |
## |                | 10\. R_1Ft8zuh600b5qQP\         | 0 ( 0.0%)\          |                      |          |         |
## |                | [ 185 others ]                  | 375 (94.9%)         |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | ID.Prolific\   | 1\. 563583d7dc62e50011cb4855\   | 0 ( 0.0%)\          | ![](temp/ds0234.png) | 395\     | 0\      |
## | [factor]       | 2\. 568d3401b5a2c2000db65f64\   | 0 ( 0.0%)\          |                      | (100.0%) | (0.0%)  |
## |                | 3\. 56e6a66af6ed900006a5867c\   | 5 ( 1.3%)\          |                      |          |         |
## |                | 4\. 56e8bf5a870a8e000b4a8d6e\   | 0 ( 0.0%)\          |                      |          |         |
## |                | 5\. 572bf2aa34b25a000edd2e73\   | 5 ( 1.3%)\          |                      |          |         |
## |                | 6\. 574dc90512d86b000f833ab0\   | 0 ( 0.0%)\          |                      |          |         |
## |                | 7\. 57d1d04593d4400001cdc0db\   | 0 ( 0.0%)\          |                      |          |         |
## |                | 8\. 57dd1a741334540001170404\   | 0 ( 0.0%)\          |                      |          |         |
## |                | 9\. 57f3b6bfa1100100016d1454\   | 5 ( 1.3%)\          |                      |          |         |
## |                | 10\. 57fc96d6279ffd000124ccd7\  | 0 ( 0.0%)\          |                      |          |         |
## |                | [ 152 others ]                  | 380 (96.2%)         |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | ID.Study\      | 1\. block1\                     | 200 (50.6%)\        | ![](temp/ds0235.png) | 395\     | 0\      |
## | [factor]       | 2\. block2\                     | 100 (25.3%)\        |                      | (100.0%) | (0.0%)  |
## |                | 3\. block6                      | 95 (24.1%)          |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | PLATFORM\      | 1\. Facebook\                   | 140 (35.4%)\        | ![](temp/ds0236.png) | 395\     | 0\      |
## | [factor]       | 2\. Instagram\                  | 95 (24.1%)\         |                      | (100.0%) | (0.0%)  |
## |                | 3\. LinkedIn\                   | 0 ( 0.0%)\          |                      |          |         |
## |                | 4\. Tumblr\                     | 5 ( 1.3%)\          |                      |          |         |
## |                | 5\. Twitter/X                   | 155 (39.2%)         |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | STIMULUS\      | 1\. B0-0\                       | 79 (20.0%)\         | ![](temp/ds0237.png) | 395\     | 0\      |
## | [factor]       | 2\. B1-1\                       | 40 (10.1%)\         |                      | (100.0%) | (0.0%)  |
## |                | 3\. B1-2\                       | 40 (10.1%)\         |                      |          |         |
## |                | 4\. B1-3\                       | 40 (10.1%)\         |                      |          |         |
## |                | 5\. B1-4\                       | 40 (10.1%)\         |                      |          |         |
## |                | 6\. B2-1\                       | 20 ( 5.1%)\         |                      |          |         |
## |                | 7\. B2-2\                       | 20 ( 5.1%)\         |                      |          |         |
## |                | 8\. B2-3\                       | 20 ( 5.1%)\         |                      |          |         |
## |                | 9\. B2-4\                       | 20 ( 5.1%)\         |                      |          |         |
## |                | 10\. B3-1\                      | 0 ( 0.0%)\          |                      |          |         |
## |                | [ 15 others ]                   | 76 (19.2%)          |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | BLOCK\         | 1\. B0\                         | 79 (20.0%)\         | ![](temp/ds0238.png) | 395\     | 0\      |
## | [factor]       | 2\. B1\                         | 160 (40.5%)\        |                      | (100.0%) | (0.0%)  |
## |                | 3\. B2\                         | 80 (20.3%)\         |                      |          |         |
## |                | 4\. B3\                         | 0 ( 0.0%)\          |                      |          |         |
## |                | 5\. B4\                         | 0 ( 0.0%)\          |                      |          |         |
## |                | 6\. B5\                         | 0 ( 0.0%)\          |                      |          |         |
## |                | 7\. B6                          | 76 (19.2%)          |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | ENCOUNTER\     | 1\. engage\                     | 219 (55.4%)\        | ![](temp/ds0239.png) | 395\     | 0\      |
## | [factor]       | 2\. scroll                      | 176 (44.6%)         |                      | (100.0%) | (0.0%)  |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_ID\      | 1\. business\                   | 88 (22.3%)\         | ![](temp/ds0240.png) | 395\     | 0\      |
## | [factor]       | 2\. political\                  | 71 (18.0%)\         |                      | (100.0%) | (0.0%)  |
## |                | 3\. education\                  | 91 (23.0%)\         |                      |          |         |
## |                | 4\. news\                       | 85 (21.5%)\         |                      |          |         |
## |                | 5\. organization\               | 22 ( 5.6%)\         |                      |          |         |
## |                | 6\. individual                  | 38 ( 9.6%)          |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_CONF\    | Mean (sd) : 60.7 (22.8)\        | 83 distinct values  | ![](temp/ds0241.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 64 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 25 (0.4)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_AGE\     | 1\. boomer\                     | 38 ( 9.6%)\         | ![](temp/ds0242.png) | 395\     | 0\      |
## | [factor]       | 2\. gen-x\                      | 166 (42.0%)\        |                      | (100.0%) | (0.0%)  |
## |                | 3\. gen-z\                      | 35 ( 8.9%)\         |                      |          |         |
## |                | 4\. millenial\                  | 113 (28.6%)\        |                      |          |         |
## |                | 5\. millennial                  | 43 (10.9%)          |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | AGE_CONF\      | Mean (sd) : 60.2 (21.3)\        | 84 distinct values  | ![](temp/ds0243.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 63 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 25 (0.4)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_GENDER\  | 1\. Female\                     | 136 (34.4%)\        | ![](temp/ds0244.png) | 395\     | 0\      |
## | [factor]       | 2\. Male\                       | 250 (63.3%)\        |                      | (100.0%) | (0.0%)  |
## |                | 3\. Other                       | 9 ( 2.3%)           |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | GENDER_CONF\   | Mean (sd) : 55.4 (24.4)\        | 86 distinct values  | ![](temp/ds0245.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 56 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 33.5 (0.4)           |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_DESIGN\  | Mean (sd) : 48.3 (28.3)\        | 93 distinct values  | ![](temp/ds0246.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 50 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 45 (0.6)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_DATA\    | Mean (sd) : 43.8 (27.8)\        | 95 distinct values  | ![](temp/ds0247.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 41 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 47 (0.6)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_POLITIC\ | Mean (sd) : 47 (19.8)\          | 88 distinct values  | ![](temp/ds0248.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 50 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 16.5 (0.4)           |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_ARGUE\   | Mean (sd) : 55.4 (20.3)\        | 80 distinct values  | ![](temp/ds0249.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 51 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 27 (0.4)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_SELF\    | Mean (sd) : 41.5 (19.2)\        | 80 distinct values  | ![](temp/ds0250.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 45 < 91\                    |                     |                      |          |         |
## |                | IQR (CV) : 22 (0.5)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_ALIGN\   | Mean (sd) : 52.5 (18.9)\        | 82 distinct values  | ![](temp/ds0251.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 51 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 17.5 (0.4)           |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_TRUST\   | Mean (sd) : 59.5 (18.9)\        | 73 distinct values  | ![](temp/ds0252.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 59 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 22 (0.3)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | MAKER_LATENCY\ | Mean (sd) : 2.6 (2)\            | 263 distinct values | ![](temp/ds0253.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0.5 < 2 < 20.6\                 |                     |                      |          |         |
## |                | IQR (CV) : 1.7 (0.8)            |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | TOOL_ID\       | 1\. ?\                          | 46 (11.6%)\         | ![](temp/ds0254.png) | 395\     | 0\      |
## | [factor]       | 2\. design_advanced\            | 77 (19.5%)\         |                      | (100.0%) | (0.0%)  |
## |                | 3\. design_advanced,?\          | 1 ( 0.3%)\          |                      |          |         |
## |                | 4\. design_advanced,programmi\  | 2 ( 0.5%)\          |                      |          |         |
## |                | 5\. design_advanced,viz_advan\  | 19 ( 4.8%)\         |                      |          |         |
## |                | 6\. design_advanced,viz_advan\  | 2 ( 0.5%)\          |                      |          |         |
## |                | 7\. design_advanced,viz_basic\  | 3 ( 0.8%)\          |                      |          |         |
## |                | 8\. design_basic\               | 77 (19.5%)\         |                      |          |         |
## |                | 9\. design_basic,?\             | 3 ( 0.8%)\          |                      |          |         |
## |                | 10\. design_basic,design_advan\ | 10 ( 2.5%)\         |                      |          |         |
## |                | [ 15 others ]                   | 155 (39.2%)         |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | TOOL_CONF\     | Mean (sd) : 63.1 (24)\          | 85 distinct values  | ![](temp/ds0255.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 65 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 29.5 (0.4)           |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | CHART_LIKE\    | Mean (sd) : 47.3 (27.3)\        | 89 distinct values  | ![](temp/ds0256.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 52 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 40 (0.6)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | CHART_BEAUTY\  | Mean (sd) : 48.3 (29)\          | 93 distinct values  | ![](temp/ds0257.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 55 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 47 (0.6)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | CHART_INTENT\  | Mean (sd) : 39.7 (30.3)\        | 94 distinct values  | ![](temp/ds0258.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 36 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 50.5 (0.8)           |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | CHART_TRUST\   | Mean (sd) : 56.5 (22.9)\        | 83 distinct values  | ![](temp/ds0259.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0 < 56 < 100\                   |                     |                      |          |         |
## |                | IQR (CV) : 28 (0.4)             |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | CHART_LATENCY\ | Mean (sd) : 1.8 (1.4)\          | 217 distinct values | ![](temp/ds0260.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               |                     |                      | (100.0%) | (0.0%)  |
## |                | 0.4 < 1.4 < 11.8\               |                     |                      |          |         |
## |                | IQR (CV) : 1.1 (0.8)            |                     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+
## | loop_number\   | Mean (sd) : 1 (1.4)\            | 0 : 235 (59.5%)\    | ![](temp/ds0261.png) | 395\     | 0\      |
## | [numeric]      | min < med < max:\               | 1 :  40 (10.1%)\    |                      | (100.0%) | (0.0%)  |
## |                | 0 < 0 < 4\                      | 2 :  40 (10.1%)\    |                      |          |         |
## |                | IQR (CV) : 2 (1.4)              | 3 :  40 (10.1%)\    |                      |          |         |
## |                |                                 | 4 :  40 (10.1%)     |                      |          |         |
## +----------------+---------------------------------+---------------------+----------------------+----------+---------+

1.2 EDA | DEMOGRAPHICS

# SURVEY RESPONSE TIME 
ggplot(data = df_data, aes( x = duration.min, fill = ID.Study)) + 
  geom_density(alpha = 0.5) + 
  labs( title = "TOTAL Response Time by Sample") + 
  easy_add_legend_title("Sample") + 
  theme_minimal()

# MAKER PAGE RESPONSE TIME 
ggplot(df_graphs, aes(x=STIMULUS, y=MAKER_LATENCY, color=ID.Study)) +
  geom_boxplot(position=position_dodge(0.9))+
  geom_jitter(position=position_jitterdodge(), alpha = 0.3) + 
  labs( title = "MAKER Page Response Time by Sample") + 
  easy_add_legend_title("Sample")+
  theme_minimal() 

# CHART PAGE RESPONSE TIME 
ggplot(df_graphs, aes(x=STIMULUS, y=CHART_LATENCY, color=ID.Study)) +
  geom_boxplot(position=position_dodge(0.9))+
  geom_jitter(position=position_jitterdodge(), alpha = 0.3) + 
  labs( title = "CHART Page Response Time by Sample") + 
  easy_add_legend_title("Sample")+
  theme_minimal() 

# EDUCATION by SAMPLE
ggplot(data = df_data, aes( x = D_education, fill = ID.Study )) + 
  geom_bar(position = position_dodge()) +
  labs( title = "EDUCATION by Sample", x = "") + 
  theme_minimal() + 
  # easy_remove_x_axis() + 
  easy_add_legend_title("Sample")

# AGE by SAMPLE
ggplot(data = df_data, aes( x = D_age, fill = ID.Study )) + 
  geom_bar(position = position_dodge()) +
  labs( title = "AGE by Sample", x = "") + 
  theme_minimal() + 
  # easy_remove_x_axis() + 
  easy_add_legend_title("")

# POLITICAL PARTY 
ggplot(data = df_data, aes( x = D_politicalParty, fill = ID.Study )) + 
  geom_bar(position = position_dodge()) +
  labs( title = "POLITICAL PARTY by Sample", x = "") + 
  theme_minimal() + 
  easy_add_legend_title("")

# SOCIAL POLITICAL SAMPLE
vals <- c("block1", "block2","block6")
leftside <- rep("left-leaning",3)
rightside <- rep("right-leaning",3)
g <- ggplot(df_data, aes(x=ID.Study, y=D_politicsSocial, color=ID.Study)) +
  geom_boxplot(position=position_dodge(0.9), width = 0.5)+
  geom_jitter(position=position_jitterdodge(), alpha = 0.3) + 
  labs( title = "SOCIAL VALUES by Sample", 
         y = "Social Politics", x = "") + 
  easy_add_legend_title("Sample") +
  theme_minimal() +
  coord_flip()  
g + guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
))  
## Warning: Removed 10 rows containing non-finite values (`stat_boxplot()`).
## Warning: Removed 10 rows containing missing values (`geom_point()`).

# FISCAL POLITICAL SAMPLE
vals <- c("block1", "block2","block6")
leftside <- rep("left-leaning",3)
rightside <- rep("right-leaning",3)
g <- ggplot(df_data, aes(x=ID.Study, y=D_politicsFiscal, color=ID.Study)) +
  geom_boxplot(position=position_dodge(0.9), width = 0.5)+
  geom_jitter(position=position_jitterdodge(), alpha = 0.3) + 
  labs( title = "FISCAL VALUES by Sample", 
         y = "Fiscal Politics", x = "") + 
  easy_add_legend_title("Sample") +
  theme_minimal() +
  coord_flip()  
g + guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
))  
## Warning: Removed 10 rows containing non-finite values (`stat_boxplot()`).
## Removed 10 rows containing missing values (`geom_point()`).

# FISCAL (VS) SOCIAL SAMPLE
ggplot(df_data, aes( x = D_politicsFiscal, y= D_politicsSocial, color = ID.Study)) +
  geom_point(alpha = 0.5) + 
  theme_minimal() + 
  easy_add_legend_title("") + 
  labs(title = "Social (vs) Fiscal Political Values by Sample", 
       x = "Fiscal Values (liberal<-->conservative)",
       y = "Social Values (liberal<-->conservative)")
## Warning: Removed 10 rows containing missing values (`geom_point()`).

#PLATFORM CHOICE
ggplot( df_data, aes( x = PLATFORM, fill = ID.Study)) + 
  geom_bar(position = "dodge") + 
  easy_add_legend_title("") + 
  theme_minimal()

1.3 BLOCK 0

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B0-0")


# BEHAVIOUR CHOICE
ggplot (df, aes ( x = ENCOUNTER, fill = ID.Study)) + 
  geom_bar(position = "dodge") + 
  labs (title = "BLOCK 0 — BEHAVIOR by Sample", x="") + 
  theme_minimal() +
  easy_remove_legend()

######### MAKER ID AND CONFIDENCE ##############
# MAKER_ID by Sample and BEHAVIOR 
a <- ggplot (df, aes( x = MAKER_ID, fill = ID.Study)) + 
  geom_bar(position = "dodge") +
  facet_grid( df$ENCOUNTER) + 
  labs (x = "") + 
  theme_minimal() +
  easy_remove_legend() 

# MAKER_CONFIDENCE by IDENTIFICATION  
b <- ggplot(df, aes( x = MAKER_ID, y = MAKER_CONF, color = ID.Study)) + 
  # geom_boxplot(position=position_dodge(0.9))+
  geom_jitter(position=position_jitterdodge(), alpha = 0.3) + 
  # labs (title = "MAKER-ID-CONFIDENCE") +
  labs (x = "") + 
  theme_minimal() + 
  easy_remove_legend()


(p <- (a / b )  + plot_annotation(
  title = 'MAKER ID & CONFIDENCE',
  subtitle = '',
  caption = ''))

###################################################


######### MAKER ID AND CONFIDENCE ##############
# MAKER_AGE by Sample and BEHAVIOR 
a <- ggplot (df, aes( x = MAKER_AGE, fill = ID.Study)) + 
  geom_bar(position = "dodge") +
  facet_grid( df$ENCOUNTER) + 
  labs (x = "") + 
  theme_minimal() +
  easy_remove_legend() 

# MAKER_CONFIDENCE by IDENTIFICATION  
b <- ggplot(df, aes( x = MAKER_AGE, y = MAKER_CONF, color = ID.Study)) + 
  # geom_boxplot(position=position_dodge(0.9))+
  geom_jitter(position=position_jitterdodge(), alpha = 0.3) + 
  # labs (title = "MAKER-AGE-CONFIDENCE") +
  labs (x = "") + 
  theme_minimal() + 
  easy_remove_legend()


(p <- (a / b )  + plot_annotation(
  title = 'MAKER AGE & CONFIDENCE',
  subtitle = '',
  caption = ''))

###################################################

1.3.1 B0 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B0-0")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b00_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b00_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b00_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b00_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b00_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b00_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 

b00_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  # easy_remove_legend() +
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")

PLOT_b0_maker <- (b00_m_design / b00_m_data / b00_m_politics / b00_m_argue / b00_m_selfish / b00_m_align / b00_m_trust) + 
  plot_annotation(
    title = "STIMULUS B0 — MILLENIAL PINK PLANTS",
    subtitle =""
  )

PLOT_b0_maker

###################################################

1.4 BLOCK 1

1.4.1 B1-1 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B1-1")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b11_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b11_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b11_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b11_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b11_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b11_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 
b11_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b1_1_maker <- (b11_m_design / b11_m_data / b11_m_politics / b11_m_argue / b11_m_selfish / b11_m_align / b11_m_trust) + 
  plot_annotation(
    title = "STIMULUS B1-1 FUSCIA HEAT MAP"
  )

PLOT_b1_1_maker

###################################################

1.4.2 B1-2 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B1-2")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b12_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b12_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b12_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b12_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b12_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b12_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 
b12_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b1_2_maker <- (b12_m_design / b12_m_data / b12_m_politics / b12_m_argue / b12_m_selfish / b12_m_align / b12_m_trust) + 
  plot_annotation(
    title = "STIMULUS B1-2 — NEWSY DUAL TIMESERIES"
  )

PLOT_b1_2_maker

###################################################

1.4.3 B1-3 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B1-3")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b13_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b13_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b13_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b13_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b13_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b13_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 
b13_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b1_3_maker <- (b13_m_design / b13_m_data / b13_m_politics / b13_m_argue / b13_m_selfish / b13_m_align / b13_m_trust) + 
  plot_annotation(
    title = "STIMULUS B1-3 — STACKED AMERICAN FLAG"
  )

PLOT_b1_3_maker

###################################################

1.4.4 B1-4 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B1-4")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b14_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b14_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b14_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b14_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b14_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b14_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 
b14_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b1_4_maker <- (b14_m_design / b14_m_data / b14_m_politics / b14_m_argue / b14_m_selfish / b14_m_align / b14_m_trust) + 
  plot_annotation(
    title = "STIMULUS B1-4 — TINY-PEOPLE-GUNS"
  )

PLOT_b1_4_maker

###################################################

1.5 BLOCK 2

1.5.1 B2-1 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B2-1")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b21_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b21_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b21_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b21_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b21_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b21_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 

b21_m_trust <-ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b2_1_maker <- (b21_m_design / b21_m_data / b21_m_politics / b21_m_argue / b21_m_selfish / b21_m_align / b21_m_trust) + 
  plot_annotation(
    title = "STIMULUS B2-1 ECONOMIST AREA BLUES"
  )

PLOT_b2_1_maker

###################################################

1.5.2 B2-2 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B2-2")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b22_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b22_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b22_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b22_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b22_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b22_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 
b22_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b2_2_maker <- (b22_m_design / b22_m_data / b22_m_politics / b22_m_argue / b22_m_selfish / b22_m_align / b22_m_trust) + 
  plot_annotation(
    title = "STIMULUS B2-2 — CLASSIC EXCEL ERROR BARS"
  )

PLOT_b2_2_maker

###################################################

1.5.3 B2-3 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B2-3")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b23_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b23_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b23_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b23_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b23_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b23_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 
b23_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b2_3_maker <- (b23_m_design / b23_m_data / b23_m_politics / b23_m_argue / b23_m_selfish / b23_m_align / b23_m_trust) + 
  plot_annotation(
    title = "STIMULUS B2-3 — HOT DESERT CLIMATE MAP"
  )

PLOT_b2_3_maker

###################################################

1.5.4 B2-4 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B2-4")

######### MAKER ATTRIBUTES ########################
vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 2 )
rightside <-rep ("LAYPERSON", 2 ) 
b24_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b24_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 2 )
rightside <-rep ("RIGHT-WING", 2 ) 
b24_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 2 )
rightside <-rep ("DIPLOMATIC", 2 ) 
b24_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 2 )
rightside <-rep ("SELFISH", 2 ) 
b24_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 2 )
rightside <-rep ("DOES", 2 ) 
b24_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 2 )
rightside <-rep ("TRUSTWORTHY", 2 ) 
b24_m_trust <- ggplot(df, aes(y = MAKER_TRUST, x = ID.Study, color = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b2_4_maker <- (b24_m_design / b24_m_data / b24_m_politics / b24_m_argue / b24_m_selfish / b24_m_align / b24_m_trust) + 
  plot_annotation(
    title = "STIMULUS B2-4 — HOLMES HOSPITAL BEDS"
  )

PLOT_b2_4_maker

###################################################

1.6 BLOCK 6

1.6.1 B6-1 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B6-1")

######### MAKER ATTRIBUTES ########################
# vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 1 )
rightside <-rep ("LAYPERSON", 1 ) 
b61_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b61_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 1 )
rightside <-rep ("RIGHT-WING", 1 ) 
b61_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 1 )
rightside <-rep ("DIPLOMATIC", 1 ) 
b61_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 1 )
rightside <-rep ("SELFISH", 1 ) 
b61_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 1 )
rightside <-rep ("DOES", 1 ) 
b61_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 1 )
rightside <-rep ("TRUSTWORTHY", 1 ) 

b61_m_trust <-ggplot(df, aes(y = MAKER_TRUST, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b6_1_maker <- (b61_m_design / b61_m_data / b61_m_politics / b61_m_argue / b61_m_selfish / b61_m_align / b61_m_trust) + 
  plot_annotation(
    title = "STIMULUS B6-1 PLACID PURPLE PIES"
  )

PLOT_b6_1_maker

###################################################

1.6.2 B6-2 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B6-2")

######### MAKER ATTRIBUTES ########################
# vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 1 )
rightside <-rep ("LAYPERSON", 1 ) 
b62_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b62_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 1 )
rightside <-rep ("RIGHT-WING", 1 ) 
b62_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 1 )
rightside <-rep ("DIPLOMATIC", 1 ) 
b62_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 1 )
rightside <-rep ("SELFISH", 1 ) 
b62_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 1 )
rightside <-rep ("DOES", 1 ) 
b62_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 1 )
rightside <-rep ("TRUSTWORTHY", 1 ) 

b62_m_trust <-ggplot(df, aes(y = MAKER_TRUST, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b6_2_maker <- (b62_m_design / b62_m_data / b62_m_politics / b62_m_argue / b62_m_selfish / b62_m_align / b62_m_trust) + 
  plot_annotation(
    title = "STIMULUS B6-2 ECONOMIST BLUE BARS"
  )

PLOT_b6_2_maker

###################################################

1.6.3 B6-3 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B6-3")

######### MAKER ATTRIBUTES ########################
# vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 1 )
rightside <-rep ("LAYPERSON", 1 ) 
b63_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b63_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 1 )
rightside <-rep ("RIGHT-WING", 1 ) 
b63_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 1 )
rightside <-rep ("DIPLOMATIC", 1 ) 
b63_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 1 )
rightside <-rep ("SELFISH", 1 ) 
b63_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 1 )
rightside <-rep ("DOES", 1 ) 
b63_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 1 )
rightside <-rep ("TRUSTWORTHY", 1 ) 

b63_m_trust <-ggplot(df, aes(y = MAKER_TRUST, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b6_3_maker <- (b63_m_design / b63_m_data / b63_m_politics / b63_m_argue / b63_m_selfish / b63_m_align / b63_m_trust) + 
  plot_annotation(
    title = "STIMULUS B6-3 FIERY OMBRE BARS"
  )

PLOT_b6_3_maker

###################################################

1.6.4 B6-4 MAKER

#FILTER DATAFRAME
df <- df_graphs %>% filter(STIMULUS == "B6-4")

######### MAKER ATTRIBUTES ########################
# vals = c("datacollar", "bluecollar")
leftside <- rep ("PROFESSIONAL", 1 )
rightside <-rep ("LAYPERSON", 1 ) 
b64_m_design <- ggplot(df, aes(y = MAKER_DESIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DESIGN")

b64_m_data <- ggplot(df, aes(y = MAKER_DATA, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-DATA")


leftside <- rep ("LEFT-WING", 1 )
rightside <-rep ("RIGHT-WING", 1 ) 
b64_m_politics <- ggplot(df, aes(y = MAKER_POLITIC, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-POLITICS")
  

leftside <- rep ("CONFRONTATIONAL", 1 )
rightside <-rep ("DIPLOMATIC", 1 ) 
b64_m_argue <- ggplot(df, aes(y = MAKER_ARGUE, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-ARGUE")
  
leftside <- rep ("ALTRUSITC", 1 )
rightside <-rep ("SELFISH", 1 ) 
b64_m_selfish <- ggplot(df, aes(y = MAKER_SELF, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SELFISH")


leftside <- rep ("Does NOT", 1 )
rightside <-rep ("DOES", 1 ) 
b64_m_align <- ggplot(df, aes(y = MAKER_ALIGN, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-SHARES-MY-VALUES")

leftside <- rep ("UNTRUSTWORTHY", 1 )
rightside <-rep ("TRUSTWORTHY", 1 ) 

b64_m_trust <-ggplot(df, aes(y = MAKER_TRUST, x = ID.Study))+
  geom_jitter(width = 0.1, alpha=0.5) + 
  scale_y_continuous(limits=c(-1,101)) +
  labs(x="", y="") +
  coord_flip() + 
  theme_minimal() + 
  easy_remove_legend() + 
  guides(
  y = guide_axis_manual(
  # breaks = vals, 
  labels = leftside  
  ),
  y.sec = guide_axis_manual(
  # breaks = vals, 
  labels = rightside
)) + 
  labs(title  = "MAKER-TRUST")


PLOT_b6_4_maker <- (b64_m_design / b64_m_data / b64_m_politics / b64_m_argue / b64_m_selfish / b64_m_align / b64_m_trust) + 
  plot_annotation(
    title = "DIRTY STACKED CIGARETTES"
  )

PLOT_b6_4_maker

###################################################

1.7 POLITICS

p_politics <- b00_m_politics / b11_m_politics / b12_m_politics / b13_m_politics / b14_m_politics / b21_m_politics / b22_m_politics / b23_m_politics / b24_m_politics /b61_m_politics / b62_m_politics / b63_m_politics / b64_m_politics 

p_politics

# gf_histogram( ~ MAKER_TRUST, data = df_graphs) %>% 
#   gf_facet_grid(STIMULUS ~ .) %>%  easy_labs( title = "MAKER TRUST by GRAPH")
# 
# gf_histogram( ~ CHART_TRUST, data = df_graphs) %>% 
#   gf_facet_grid(STIMULUS ~ .) %>%  easy_labs( title = "CHART TRUST by GRAPH")
# 
# 
# gf_histogram( ~ MAKER_CONF, data = df_graphs) %>%  easy_labs( title = "MAKER CONF by GRAPH")
# # %>% 
#   gf_facet_grid(STIMULUS ~ .) 
# 
# #MAKER CHARS 
# df <- df_graphs %>% select(ID.Study:STIMULUS, ENCOUNTER, MAKER_ID:MAKER_LATENCY) %>% 
#   mutate(
#     STIMULUS = factor(STIMULUS) #refactor to get rid of extra empty levels 
#   )
# 
# #MAKER CHARS 
# df <- df_graphs %>% select(ID.Study:STIMULUS, ENCOUNTER, MAKER_ID:MAKER_LATENCY) %>% 
#   mutate(
#     STIMULUS = factor(STIMULUS) #refactor to get rid of extra empty levels 
#   )
# 
# ## CHART 
# df <- df_graphs %>% select(ID.Study, STIMULUS, ENCOUNTER, CHART_LIKE:loop_number) %>% 
#   mutate(
#     STIMULUS = factor(STIMULUS) #refactor to get rid of extra empty levels 
#   )
# 
# ggpairs(df, mapping = aes(color = STIMULUS)) 
# 




## MAKER CHARACTERISTICS 
df_1 <- df_graphs %>% 
  # filter(STIMULUS == "B0-0") %>% 
  select(ID.Study, MAKER_ID, MAKER_AGE, MAKER_GENDER, 
         MAKER_DESIGN: MAKER_TRUST)
         

g <- ggpairs(df_1, 
        mapping = aes(color = ID.Study, alpha = 0.05),
        showStrips = TRUE,
        title = "STIMULUS 0 MAKER CHARACTERISTICS BY SAMPLE") + 
    theme_minimal()


g

2 MODELLING

##STATSPLOT
grouped_ggwithinstats(
  data  = df_graphs,
  x     = STIMULUS,
  y     = CHART_TRUST,
  grouping.var = ID.Study
) 

grouped_ggscatterstats(
  data = df_graphs, ## data frame from which variables are taken
  x = CHART_BEAUTY, ## predictor/independent variable
  y = CHART_TRUST, ## dependent variable
  grouping.var = ID.Study,
  xlab = "CHART BEAUTY", ## label for the x-axis
  ylab = "CHART TRUST", ## label for the y-axis
  # label.expression = rating < 5 & budget > 100, ## expression for deciding which points to label
  point.label.args = list(alpha = 0.7, size = 4, color = "grey50"),
  xfill = "#CC79A7", ## fill for marginals on the x-axis
  yfill = "#009E73" ## fill for marginals on the y-axis
  # title = "CHART TRUST (VS) MAKER TRUST",
  # caption = ""
)

gf_point( data = df_graphs, CHART_TRUST~MAKER_TRUST, color = ~STIMULUS) %>% gf_facet_wrap(~STIMULUS)

grouped_ggscatterstats(
  data = df_graphs, ## data frame from which variables are taken
  x = MAKER_TRUST, ## predictor/independent variable
  y = CHART_TRUST, ## dependent variable
  grouping.var = ID.Study,
  xlab = "MAKER TRUST", ## label for the x-axis
  ylab = "CHART TRUST", ## label for the y-axis
  # label.expression = rating < 5 & budget > 100, ## expression for deciding which points to label
  point.label.args = list(alpha = 0.7, size = 4, color = "grey50"),
  xfill = "#CC79A7", ## fill for marginals on the x-axis
  yfill = "#009E73" ## fill for marginals on the y-axis
  # title = "CHART TRUST (VS) MAKER TRUST",
  # caption = ""
)

gf_point( data = df_graphs, MAKER_TRUST~CHART_TRUST, color = ~STIMULUS) %>% gf_facet_wrap(~STIMULUS)

grouped_ggscatterstats(
  data = df_graphs, ## data frame from which variables are taken
  x = CHART_BEAUTY, ## predictor/independent variable
  y = MAKER_ALIGN, ## dependent variable
  grouping.var = ID.Study,
  xlab = "CHART BEAUTY", ## label for the x-axis
  ylab = "MAKER ALIGN", ## label for the y-axis
  # label.expression = rating < 5 & budget > 100, ## expression for deciding which points to label
  point.label.args = list(alpha = 0.7, size = 4, color = "grey50"),
  xfill = "#CC79A7", ## fill for marginals on the x-axis
  yfill = "#009E73" ## fill for marginals on the y-axis
  # title = "CHART TRUST (VS) MAKER TRUST",
  # caption = ""
)

gf_point( data = df_graphs, MAKER_ALIGN~CHART_BEAUTY, color = ~STIMULUS) %>% gf_facet_wrap(~STIMULUS)

ggscatterstats(
  data = df_graphs %>% filter(STIMULUS=="B0-0"), ## data frame from which variables are taken
  x = CHART_BEAUTY, ## predictor/independent variable
  y = MAKER_TRUST, ## dependent variable
  xlab = "CHART BEAUTY", ## label for the x-axis
  ylab = "MAKER TRUST", ## label for the y-axis
  # label.expression = rating < 5 & budget > 100, ## expression for deciding which points to label
  point.label.args = list(alpha = 0.7, size = 4, color = "grey50"),
  xfill = "#CC79A7", ## fill for marginals on the x-axis
  yfill = "#009E73" ## fill for marginals on the y-axis
  # title = "CHART TRUST (VS) MAKER TRUST",
  # caption = ""
)

gf_point( data = df_graphs %>% filter(STIMULUS=="B0-0"), CHART_TRUST~CHART_BEAUTY, color = ~STIMULUS) %>% gf_facet_wrap(~STIMULUS)

gf_point( data = df_graphs %>% filter(STIMULUS=="B0-0"), MAKER_TRUST~CHART_BEAUTY, color = ~STIMULUS) %>% gf_facet_wrap(~STIMULUS)

#TODO CENTERING AND NORMALIZING

### little model
df <- df_graphs %>% filter(STIMULUS == "B0-0")
m <- lm( CHART_TRUST ~ CHART_BEAUTY,data = df)
summary(m)
## 
## Call:
## lm(formula = CHART_TRUST ~ CHART_BEAUTY, data = df)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -39.215 -10.530  -3.158  10.926  46.916 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  33.08449    4.12657   8.017 9.41e-12 ***
## CHART_BEAUTY  0.46127    0.07663   6.019 5.57e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.91 on 77 degrees of freedom
## Multiple R-squared:   0.32,  Adjusted R-squared:  0.3111 
## F-statistic: 36.23 on 1 and 77 DF,  p-value: 5.57e-08
ggnostic(m) #GGALLY MODEL CHECKS
## `geom_smooth()` using method = 'loess'

check_model(m) #EASY STATS MODEL CHECKS 

report(m)
## We fitted a linear model (estimated using OLS) to predict CHART_TRUST with
## CHART_BEAUTY (formula: CHART_TRUST ~ CHART_BEAUTY). The model explains a
## statistically significant and substantial proportion of variance (R2 = 0.32,
## F(1, 77) = 36.23, p < .001, adj. R2 = 0.31). The model's intercept,
## corresponding to CHART_BEAUTY = 0, is at 33.08 (95% CI [24.87, 41.30], t(77) =
## 8.02, p < .001). Within this model:
## 
##   - The effect of CHART BEAUTY is statistically significant and positive (beta =
## 0.46, 95% CI [0.31, 0.61], t(77) = 6.02, p < .001; Std. beta = 0.57, 95% CI
## [0.38, 0.75])
## 
## Standardized parameters were obtained by fitting the model on a standardized
## version of the dataset. 95% Confidence Intervals (CIs) and p-values were
## computed using a Wald t-distribution approximation.
### MORE COMPLEX MODEL
df <- df_graphs %>% filter(STIMULUS != "B0-0")
m1 <- lmer(CHART_TRUST ~ CHART_BEAUTY + (1|ID.Qualtrics), data = df)
m2 <- lmer(CHART_TRUST ~ CHART_BEAUTY + (1|STIMULUS), data = df)
m3 <- lmer(CHART_TRUST ~ CHART_BEAUTY + (1 | STIMULUS) + (1 | ID.Qualtrics), data = df)
summary(m1)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: CHART_TRUST ~ CHART_BEAUTY + (1 | ID.Qualtrics)
##    Data: df
## 
## REML criterion at convergence: 2775.8
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.87069 -0.60474  0.05132  0.60281  2.79623 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  ID.Qualtrics (Intercept)  72.53    8.517  
##  Residual                 325.84   18.051  
## Number of obs: 316, groups:  ID.Qualtrics, 79
## 
## Fixed effects:
##               Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   38.51241    2.29867 242.44549   16.75   <2e-16 ***
## CHART_BEAUTY   0.37993    0.03736 306.33242   10.17   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr)
## CHART_BEAUT -0.794
summary(m2)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: CHART_TRUST ~ CHART_BEAUTY + (1 | STIMULUS)
##    Data: df
## 
## REML criterion at convergence: 2770.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.85008 -0.55684 -0.00912  0.64821  2.97881 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  STIMULUS (Intercept)  36.99    6.082  
##  Residual             358.47   18.933  
## Number of obs: 316, groups:  STIMULUS, 12
## 
## Fixed effects:
##               Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   37.36026    2.82092  36.37106   13.24 1.75e-15 ***
## CHART_BEAUTY   0.40853    0.03822 313.64386   10.69  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr)
## CHART_BEAUT -0.676
summary(m3)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: CHART_TRUST ~ CHART_BEAUTY + (1 | STIMULUS) + (1 | ID.Qualtrics)
##    Data: df
## 
## REML criterion at convergence: 2748.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.94622 -0.51108 -0.01827  0.61790  2.62979 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  ID.Qualtrics (Intercept)  86.90    9.322  
##  STIMULUS     (Intercept)  40.58    6.370  
##  Residual                 270.68   16.452  
## Number of obs: 316, groups:  ID.Qualtrics, 79; STIMULUS, 12
## 
## Fixed effects:
##               Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   37.43422    2.96375  40.91373   12.63 1.05e-15 ***
## CHART_BEAUTY   0.40644    0.03643 299.75005   11.16  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr)
## CHART_BEAUT -0.612
compare_parameters(m1,m2,m3)
## Parameter    |                   m1 |                   m2 |                   m3
## ---------------------------------------------------------------------------------
## (Intercept)  | 38.51 (33.99, 43.04) | 37.36 (31.81, 42.91) | 37.43 (31.60, 43.27)
## CHART BEAUTY |  0.38 ( 0.31,  0.45) |  0.41 ( 0.33,  0.48) |  0.41 ( 0.33,  0.48)
## ---------------------------------------------------------------------------------
## Observations |                  316 |                  316 |                  316
compare_performance(m1,m2,m3, rank = TRUE)
## Some of the nested models seem to be identical and probably only vary in
##   their random effects.
## # Comparison of Model Performance Indices
## 
## Name |           Model | R2 (cond.) | R2 (marg.) |   ICC |   RMSE |  Sigma | AIC weights | AICc weights | BIC weights | Performance-Score
## -----------------------------------------------------------------------------------------------------------------------------------------
## m3   | lmerModLmerTest |      0.499 |      0.263 | 0.320 | 15.000 | 16.452 |       1.000 |        1.000 |       1.000 |            98.55%
## m1   | lmerModLmerTest |      0.376 |      0.237 | 0.182 | 16.911 | 18.051 |    4.35e-06 |     4.49e-06 |    2.84e-05 |            18.42%
## m2   | lmerModLmerTest |      0.335 |      0.266 | 0.094 | 18.637 | 18.933 |    4.78e-05 |     4.94e-05 |    3.13e-04 |            12.50%
m <- lmer(CHART_TRUST ~ CHART_BEAUTY + MAKER_TRUST + (1 | STIMULUS) ,  data = df)
mi <- lmer(CHART_TRUST ~ CHART_BEAUTY * MAKER_TRUST + (1 | STIMULUS) , data = df)
## Warning: Some predictor variables are on very different scales: consider
## rescaling

## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(m)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: CHART_TRUST ~ CHART_BEAUTY + MAKER_TRUST + (1 | STIMULUS)
##    Data: df
## 
## REML criterion at convergence: 2570.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.9960 -0.4934  0.0473  0.5461  4.0281 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  STIMULUS (Intercept)   8.959   2.993  
##  Residual             190.831  13.814  
## Number of obs: 316, groups:  STIMULUS, 12
## 
## Fixed effects:
##               Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)    2.04928    2.75656 162.79302   0.743    0.458    
## CHART_BEAUTY   0.20421    0.02991 301.68892   6.827 4.77e-11 ***
## MAKER_TRUST    0.77073    0.04522 312.47965  17.044  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) CHART_
## CHART_BEAUT -0.161       
## MAKER_TRUST -0.755 -0.391
summary(mi)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: CHART_TRUST ~ CHART_BEAUTY * MAKER_TRUST + (1 | STIMULUS)
##    Data: df
## 
## REML criterion at convergence: 2581.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.9692 -0.4927  0.0482  0.5528  4.0155 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  STIMULUS (Intercept)   9.084   3.014  
##  Residual             191.395  13.835  
## Number of obs: 316, groups:  STIMULUS, 12
## 
## Fixed effects:
##                           Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)              2.424e+00  4.272e+00 2.674e+02   0.567   0.5709    
## CHART_BEAUTY             1.956e-01  8.215e-02 3.095e+02   2.380   0.0179 *  
## MAKER_TRUST              7.639e-01  7.470e-02 3.106e+02  10.226   <2e-16 ***
## CHART_BEAUTY:MAKER_TRUST 1.465e-04  1.288e-03 3.112e+02   0.114   0.9095    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##               (Intr) CHART_BEAUTY MAKER_
## CHART_BEAUTY  -0.748                    
## MAKER_TRUST   -0.903  0.654             
## CHART_BEAUTY:  0.763 -0.931       -0.795
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
compare_performance(m3,m,mi, rank = TRUE)
## # Comparison of Model Performance Indices
## 
## Name |           Model | R2 (cond.) | R2 (marg.) |   ICC |   RMSE |  Sigma | AIC weights | AICc weights | BIC weights | Performance-Score
## -----------------------------------------------------------------------------------------------------------------------------------------
## m    | lmerModLmerTest |      0.633 |      0.616 | 0.045 | 13.620 | 13.814 |       0.730 |        0.738 |       0.947 |            87.48%
## mi   | lmerModLmerTest |      0.632 |      0.615 | 0.045 | 13.617 | 13.835 |       0.270 |        0.262 |       0.053 |            59.59%
## m3   | lmerModLmerTest |      0.499 |      0.263 | 0.320 | 15.000 | 16.452 |    7.09e-41 |     7.17e-41 |    9.19e-41 |            12.50%
report(m)
## We fitted a linear mixed model (estimated using REML and nloptwrap optimizer)
## to predict CHART_TRUST with CHART_BEAUTY and MAKER_TRUST (formula: CHART_TRUST
## ~ CHART_BEAUTY + MAKER_TRUST). The model included STIMULUS as random effect
## (formula: ~1 | STIMULUS). The model's total explanatory power is substantial
## (conditional R2 = 0.63) and the part related to the fixed effects alone
## (marginal R2) is of 0.62. The model's intercept, corresponding to CHART_BEAUTY
## = 0 and MAKER_TRUST = 0, is at 2.05 (95% CI [-3.37, 7.47], t(311) = 0.74, p =
## 0.458). Within this model:
## 
##   - The effect of CHART BEAUTY is statistically significant and positive (beta =
## 0.20, 95% CI [0.15, 0.26], t(311) = 6.83, p < .001; Std. beta = 0.26, 95% CI
## [0.19, 0.34])
##   - The effect of MAKER TRUST is statistically significant and positive (beta =
## 0.77, 95% CI [0.68, 0.86], t(311) = 17.04, p < .001; Std. beta = 0.64, 95% CI
## [0.57, 0.72])
## 
## Standardized parameters were obtained by fitting the model on a standardized
## version of the dataset. 95% Confidence Intervals (CIs) and p-values were
## computed using a Wald t-distribution approximation.
#todo see https://yury-zablotski.netlify.app/post/mixed-effects-models-2/ about fitting with ML vs REML for model comparison 
# #TODO WALK THROUGH THIS 
# #https://yury-zablotski.netlify.app/post/mixed-models/#multiple-random-slope-model
# 
# #load example data
# data("sleepstudy")
# 
# #fit the model
# m_slp <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
# 
# #the next line put all the estimated intercept and slope per subject into a dataframe
# reaction_slp <- as.data.frame(t(apply(ranef(m_slp)$Subject, 1,function(x) fixef(m_slp) + x)))
# 
# #to get the predicted regression lines we need one further step, writing the linear equation: Intercept + Slope*Days with different coefficient for each subject
# pred_slp <- melt(apply(reaction_slp,1,function(x) x[1] + x[2]*0:9), value.name = "Reaction")
# 
# #some re-formatting for the plot
# names(pred_slp)[1:2] <- c("Days","Subject")
# pred_slp$Days <- pred_slp$Days - 1
# pred_slp$Subject <- as.factor(pred_slp$Subject)
# 
# #plot with actual data 
# ggplot(pred_slp,aes(x=Days,y=Reaction,color=Subject))+
#   geom_line()+
#   geom_point(data=sleepstudy,aes(x=Days,y=Reaction))+
#   facet_wrap(~Subject,nrow=3)